package com.atguigu.spzx.product.controller;

import com.atguigu.spzx.model.result.Result;
import com.atguigu.spzx.model.vo.h5.IndexVo;
import com.atguigu.spzx.product.service.IndexService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Tag(name = "首页模块")
//@CrossOrigin
@RequestMapping("/api/product/index")
public class IndexController {
    @Resource
    IndexService indexService;
    @GetMapping
    @Operation(summary = "查询首页一级分类列表和热销商品列表接口")
    public Result index(){
        IndexVo indexVo = indexService.index();
        return Result.ok(indexVo);
    }
}
